<template>
  <div class="tabbar">
    <div class="w-tabbar weui-tabbar" >
      <router-link v-bind:to="item.link" :class="classA" v-for="item in items"><span :class="item.classC"></span><p :class="classB">{{ item.tabName }}</p></router-link>
    </div>
  </div>
</template>

<script>

export default {
  name: 'tabbar',
  data () {
    return {
      classA:'weui-tabbar__item',
      classB:'weui-tabbar-label',
      items:[
        { link:'/dist/Home',classC:'iconfont icon-Sy',tabName:'首页'},
        // { link:'/dist/Find',classC:'iconfont icon-Fx',tabName:'发现'},
        { link:'/dist/Menu',classC:'iconfont icon-Dd',tabName:'订单'},
        { link:'/dist/Person',classC:'iconfont icon-Gr',tabName:'个人中心'}
      ]
    }
  }
}

</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
/* 底部导航 */
.w-tabbar{
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 999;
  display: -webkit-flex;
  width: 100%;
  background-color: #fff;
}
.weui-tabbar__item{
  padding: 0;
  color: #555;
}
.weui-tabbar__item{
  display: block;
    -webkit-box-flex: 1;
    flex: 1;
    padding: 5px 0 0;
    font-size: 0;
    color: #999;
    text-align: center;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}
.w-tabbar .weui-tabbar-label{
  font-size: 12px;
  margin-top:-4px;
  text-align: center;
  font-size: 10px;
  line-height: 1.8;
}
.weui-tabbar .weui-bar__item_on .iconfont{
  color: #fe4e4c;
}
.weui-tabbar .weui-tabbar__item .iconfont{
  font-size: 24px;
}
.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label {
    color: #fe4e4c;
}
.w-badge{
  position: absolute;
  top: 2px;
  right: -14px;
  background-color: #fe4e4c;
}
.router-link-active{
  color:#ff4d4d;
}
</style>
